<template>
    <el-dialog  :title="title" :visible.sync="show"
                :close-on-click-modal='true'
                :modal="false"
                append-to-body="false" :width="width" @close="close">
      <div class="main">
        <slot></slot>
      </div>
      <span slot="footer">
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="confirm()">{{btnText}}</el-button>
      </span>
    </el-dialog>
</template>

<script>

export default {
  name: "zl-dialog",
  props: {
    show:{
      type: Boolean,
      default: false,
    },
    title:{
      type: String,
      default: '详细',
    },
    btnText:{
      type: String,
      default: '确 认',
    },
    width:{
      type: String,
      default: '50%',
    },
  },
  data() {
    return {

    };
  },
  methods: {

    close(){
      this.$emit('close')
    },
    confirm(){
      this.$emit('confirm')
    }

  }


}


</script>



<style scoped>

</style>
